﻿using System;
using System.ComponentModel.DataAnnotations;
using System.Web.Mvc;
using System.Collections.Generic;

namespace Agenda_Project.Models
{
    public abstract class DataModel : MasterModel
    {
        [Display(Name = "Remark", Order = 5)]
        public string Remark { get; set; }

        [Display(AutoGenerateField = false)]
        public long CancelByID { get; set; }

        [Display(AutoGenerateField = false)]
        public string CancelDate { get; set; }

        [Display(AutoGenerateField = false)]
        public string CancelTime { get; set; }
    }

    public partial class Committee : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(Name = "Committee Members", Order = 6)]
        public virtual ICollection<CommitteeMember> CommitteeMembers { get; set; }

        public Committee()
        {
            this.CommitteeMembers = new HashSet<CommitteeMember>();
        }
    }

    public partial class CommitteeMember : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public long CommitteeID { get; set; }
        [Display(AutoGenerateField = false)]
        public byte CommitteeRoleID { get; set; }
        [Display(AutoGenerateField = false)]
        public long UserID { get; set; }

        [Display(Name = "Committee", Order = 6)]
        public virtual Committee Committee { get; set; }

        [Display(Name = "Committee Role", Order = 7)]
        public virtual CommitteeRole CommitteeRole { get; set; }

        [Display(Name = "User", Order = 8)]
        public virtual User User { get; set; }

        [Display(Name = "Period", Order = 9)]
        public DateTimePeriod Period { get; set; }

        public CommitteeMember()
        {
            this.Period = new DateTimePeriod();
        }
    }

    public partial class Meeting : DataModel 
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public byte MeetingTypeID { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingMember> tbl_meeting_member { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingAgenda> tbl_meeting_agenda { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingReport> tbl_meeting_report { get; set; }

        [Display(Name = "Meeting Type", Order = 6)]
        public virtual MeetingType MeetingType { get; set; }

        [Display(Name = "Document No.", Order = 7)]
        public string DocumentNo { get; set; }

        [Display(Name = "Building", Order = 8)]
        public string Building { get; set; }

        [Display(Name = "Floor", Order = 9)]
        public string Floor { get; set; }

        [Display(Name = "Room", Order = 10)]
        public string Room { get; set; }

        [Display(Name = "Period", Order = 11)]
        public DateTimePeriod Period { get; set; }

        [Display(Name = "Sent e-mail to members ?", Order = 12)]
        public bool IsSentMail { get; set; }

        public Meeting()
        {
            this.tbl_meeting_member = new HashSet<MeetingMember>();
            this.tbl_meeting_agenda = new HashSet<MeetingAgenda>();
            this.tbl_meeting_report = new HashSet<MeetingReport>();
            this.Period = new DateTimePeriod();
        }
    }

    public partial class MeetingAgenda : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public byte OwnerTypeID { get; set; }
        [Display(AutoGenerateField = false)]
        public long OwnerID { get; set; }
        [Display(AutoGenerateField = false)]
        public long MeetingID { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingAgendaTopic> MeetingAgendaTopics { get; set; }

        [Display(Name = "Owner Type", Order = 6)]
        public virtual OwnerType OwnerType { get; set; }

        [Display(Name = "Owner", Order = 7)]
        public virtual User Owner { get; set; }

        [Display(Name = "Owner Name", Order = 8)]
        public string OwnerName { get; set; }

        [Display(Name = "Meeting", Order = 9)]
        public virtual Meeting Meeting { get; set; }

        [Display(Name = "Processed ?", Order = 10)]
        public bool IsProcessed { get; set; }

        public MeetingAgenda()
        {
            this.MeetingAgendaTopics = new HashSet<MeetingAgendaTopic>();
        }
    }

    public partial class MeetingAgendaTopic : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public long AgendaID { get; set; }
        [Display(AutoGenerateField = false)]
        public byte TopicTypeID { get; set; }
        [Display(AutoGenerateField = false)]
        public long ReferenceTopicID { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingAgendaTopic> ReferenceTopics { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingMemberVote> MeetingMemberVotes { get; set; }


        [Display(Name = "Agenda", Order = 6)]
        public virtual MeetingAgenda Agenda { get; set; }

        [Display(Name = "Topic Type", Order = 7)]
        public virtual TopicType TopicType { get; set; }

        [Display(Name = "Reference Topic", Order = 8)]
        public virtual MeetingAgendaTopic ReferenceTopic { get; set; }

        [Display(Name = "Topic Content", Order = 9)]
        [DataType(DataType.MultilineText)]
        public string TopicContent { get; set; }

        [Display(Name = "Meeting Content", Order = 10)]
        [DataType(DataType.MultilineText)]
        public string MeetingContent { get; set; }

        [Display(Name = "Accepted ?", Order = 11)]
        public bool IsAccepted { get; set; }

        [Display(Name = "Accepted Condition", Order = 12)]
        public string Condition { get; set; }

        public MeetingAgendaTopic()
        {
            this.ReferenceTopics = new HashSet<MeetingAgendaTopic>();
            this.MeetingMemberVotes = new HashSet<MeetingMemberVote>();
        }
    }

    public partial class MeetingMember : DataModel
    {
        [Display(AutoGenerateField = false)]
        public long MeetingID { get; set; }
        [Display(AutoGenerateField = false)]
        public long MemberID { get; set; }
        [Display(AutoGenerateField = false)]
        public byte RoleTypeID { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual ICollection<MeetingMemberVote> MeetingMemberVotes { get; set; }

        [Display(Name = "Meeting", Order = 6)]
        public virtual Meeting Meeting { get; set; }
        
        [Display(Name = "Member", Order = 7)]
        public virtual User Member { get; set; }

        [Display(Name = "Role", Order = 8)]
        public virtual CommitteeRole RoleType { get; set; }

        [Display(Name = "Participated ?", Order = 9)]
        public bool IsParticipate { get; set; }

        public MeetingMember()
        {
            this.MeetingMemberVotes = new HashSet<MeetingMemberVote>();
        }
    }

    public partial class MeetingMemberVote : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public long TopicID { get; set; }
        [Display(AutoGenerateField = false)]
        public long MemberID { get; set; }
        [Display(AutoGenerateField = false)]
        public byte VoteTypeID { get; set; }

        [Display(Name = "Topic", Order = 6)]
        public virtual MeetingAgendaTopic Topic { get; set; }

        [Display(Name = "Member", Order = 7)]
        public virtual MeetingMember Member { get; set; }

        [Display(Name = "Vote Type", Order = 8)]
        public virtual VoteType VoteType { get; set; }
    }

    public partial class MeetingReport : DataModel
    {
        [Display(AutoGenerateField = false)]
        public virtual User CreateBy { get; set; }
        [Display(AutoGenerateField = false)]
        public virtual User CancelBy { get; set; }
        [Display(AutoGenerateField = false)]
        public long MeetingID { get; set; }
        [Display(AutoGenerateField = false)]
        public long ReviewByID { get; set; }
        [Display(AutoGenerateField = false)]
        public long AssureByID { get; set; }
        
        [Display(Name = "Meeting", Order = 6)]
        public virtual Meeting Meeting { get; set; }

        [Display(Name = "Review By", Order = 7)]
        public virtual User ReviewBy { get; set; }

        [Display(Name = "Assure By", Order = 8)]
        public virtual User AssureBy { get; set; }

        [Display(Name = "Revision", Order = 9)]
        public string Revision { get; set; }
    }
}